﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OneRed.Draw
{
    public class labelConect : labelBase
    {
        public string sFrom { get; set; }
        public string sTo { get; set; }
        public double dGongPinci { get; set; }
        public double dJuli { get; set; }

        public labelInfo lFrom { get; set; }
        public labelInfo lTo { get; set; }

        public labelConect(string from, string to, double dGongPinci)
        {
            this.sFrom = from;
            this.sTo = to;
            this.dGongPinci = dGongPinci;
        }
        public labelConect()
        {
        }

        public labelConect(labelInfo lfrom, labelInfo lto)
        {
            lFrom = lfrom;
            lTo = lto;
        }
    }

    abstract public class labelBase
    {
        public string sLabelname { get; set; }
        public string sID { get; set; }
        public bool blShowLable { get; set; }
    }

    public class labelInfo : labelBase
    {
        public double dCiPin { get; set; }//节点全部出现的次数 频次
        public double dCiLv { get; set; }//含有该词文件数/词频 频率
        public double dCiDoc { get; set; }//含有该词的文件数
        public double dWordsLength { get; set; }//单词串的长度

        public double dWH { get; set; }//通过log计算节点圆圈的大小
        public double dDgree { get; set; }//非主节点接收主节点的度数值
        public double dX { get; set; }
        public double dY { get; set; }
        public int iOtherCodesNum { get; set; }
        public double dRadius { get; set; }//保存节点目前的直径值

        public bool blRoot//判断是否为主节点
        {
            get;
            set;
        }
        //public string lsYears { get; set; }//该词在哪些年出现过
        private List<string> _lsYears = new List<string>(); //X=year Y=num
        public List<string> lsYears
        {
            get { return _lsYears; }
            set
            {

                if (_lsYears != value)

                    _lsYears = value;
            }
        }
        //与年对应的单位在相应年出现的数量数组
        private List<int> _lsYearsNum = new List<int>(); //X=year Y=num
        public List<int> lsYearsNum
        {
            get { return _lsYearsNum; }
            set
            {

                if (_lsYearsNum != value)

                    _lsYearsNum = value;
            }
        }
        public int iYearNumMax { get; set; }//统计关键词对应年份出现值最大的那个值
        public int iYearNumAll { get; set; }//统计关键词所有年份出现值的和

        public List<string> lsOtherCodesName = new List<string>();
        public List<double> lsOtherCodesJuli = new List<double>();
        public labelInfo()
        {
        }
        public labelInfo(string sName, double dCipin)
        {
            sLabelname = sName;
            dCiPin = dCipin;
        }
        public labelInfo(string sName, double Xpostion, double Ypostion)
        {
            sLabelname = sName;
            dX = Xpostion;
            dY = Ypostion;
        }
    }

    /// <summary>
    /// 导入数据规范类
    /// </summary>
    public abstract class standerDataBase : INotifyPropertyChanged
    {
        private string psType;//文档类型 对应RT
        private string psSR;//cnki的一个类型，不知道是啥用
        private string psAuthor;//作者，硕博论文的毕业生名称
        private string psAuthorOrgan;
        private string psTitle;
        private string psYear;
        private string psKeywords;
        private string psEnglishKeywords;
        private string psSummary;
        private string psLanguage;
        private string psSource;
        public string sSR
        {
            get
            {
                return psSR;
            }
            set
            {
                psSR = value;
                OnPropertyChanged("sSR");
            }
        }//SR 1
        public string sType
        {
            get
            {
                return psType;
            }
            set
            {
                psType = value;
                OnPropertyChanged("sType");
            }
        }// RT Journal Article
        public string sAuthor
        {
            get
            {
                return psAuthor;
            }
            set
            {
                psAuthor = value;
                OnPropertyChanged("sAuthor");
            }
        }//A1 黄辉;陆利忠;闫镔;陈健;
        public string sAuthorOrgan
        {
            get
            {
                return psAuthorOrgan;
            }
            set
            {
                psAuthorOrgan = value;
                OnPropertyChanged("sAuthorOrgan");
            }
        }//AD 信息工程大学信息工程学院;
        public string sTitle
        {
            get
            {
                return psTitle;
            }
            set
            {
                psTitle = value;
                OnPropertyChanged("sTitle");
            }
        }//T1 三维可视化技术研究

        public string sYear
        {
            get
            {
                return psYear;
            }
            set
            {
                psYear = value;
                OnPropertyChanged("sYear");
            }
        }//YR 2010
        public string sKeywords
        {
            get
            {
                return psKeywords;
            }
            set
            {
                psKeywords = value;
                OnPropertyChanged("sKeywords");
            }
        }//K1 三维可视化技术;面绘制;体绘制;点绘制;VTK
        public string sSummary
        {
            get
            {
                return psSummary;
            }
            set
            {
                psSummary = value;
                OnPropertyChanged("sSummary");
            }
        }//AB 三维可视化技术在医学及工业领域应用广泛。文章首先介绍了三维可视化技术的概念,分析了三维可视化技术的原理和关键算法,即面绘制、体绘制、点绘制算法;然后对三维可视化开发包VTK进行了介绍,并以Ray Casting算法为例给出了基于VTK的三维体绘制算法的实现过程;最后对三维可视化技术的发展趋势进行了展望。
        public string sLanguage
        {
            get
            {
                return psLanguage;
            }
            set
            {
                psLanguage = value;
                OnPropertyChanged("sLanguage");
            }
        }//LA 中文;
        public string sSource
        {
            get
            {
                return psSource;
            }
            set
            {
                psSource = value;
                OnPropertyChanged("sSource");
            }
        }//DS CNKI
        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
    /// <summary>
    /// 硕博论文
    /// </summary>
    class standerThesis : standerDataBase
    {
        //private string psAuthor;//论文的作者
        private string psTearchers;//导师
        private string psGrade;//论文学术级别
        public string sTearchers
        {
            get
            {
                return psTearchers;
            }
            set
            {
                psTearchers = value;
                OnPropertyChanged("sTearchers");
            }
        }//A3 董槐林
        public string sGrade
        {
            get
            {
                return psGrade;
            }
            set
            {
                psGrade = value;
                OnPropertyChanged("sGrade");
            }
        }//CL 硕士
         //public string sFromUnit{get;set;}//PB 厦门大学
        new public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

    public class standerJournal : standerDataBase
    {
        private string psJournal;
        public string sJournal
        {
            get
            {
                return psJournal;
            }
            set
            {
                psJournal = value;
                OnPropertyChanged("sJournal");
            }
        }//JF 信息工程大学学报

        private string psCites;//引文
        public string sCites
        {
            get
            {
                return psCites;
            }
            set
            {
                psCites = value;
                OnPropertyChanged("sCites");
            }
        }
        private string psCLCode;//分类号
        public string sCLCode
        {
            get
            {
                return psCLCode;
            }
            set
            {
                psCLCode = value;
                OnPropertyChanged("sCLCode");
            }
        }
        private string psSujectClass;//学科类别
        public string sSujectClass
        {
            get
            {
                return psSujectClass;
            }
            set
            {
                psSujectClass = value;
                OnPropertyChanged("sSujectClass");
            }
        }
        private string psPeriod;
        public string sPeriod
        {
            get
            {
                return psPeriod;
            }
            set
            {
                psPeriod = value;
                OnPropertyChanged("sPeriod");
            }
        }//IS 02 期数
        private string psPages;
        public string sPages
        {
            get
            {
                return psPages;
            }
            set
            {
                psPages = value;
                OnPropertyChanged("sPages");
            }
        }//OP 218-222+247 页数
        private string psIssn;
        public string sIssn
        {
            get
            {
                return psIssn;
            }
            set
            {
                psIssn = value;
                OnPropertyChanged("sIssn");
            }
        }//SN 1671-0673
        private string psCN;
        public string sCN
        {
            get
            {
                return psCN;
            }
            set
            {
                psCN = value;
                OnPropertyChanged("sCN");
            }
        }//CN 41-1196/N

        private string psTearchers;//导师
        public string sTearchers
        {
            get
            {
                return psTearchers;
            }
            set
            {
                psTearchers = value;
                OnPropertyChanged("sTearchers");
            }
        }//A3 董槐林

        private string psGrade;//论文学术级别
        public string sGrade
        {
            get
            {
                return psGrade;
            }
            set
            {
                psGrade = value;
                OnPropertyChanged("sGrade");
            }
        }//CL 硕士

        new public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

}
